package com.dl.mian.ui;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutResid());
        initViews();
        initData();
        addEvent();
    }

    protected void addEvent() {
    }

    protected void initData() {
    }

    protected void initViews() {
    }

    protected int getLayoutResid() {
        return 0;
    }

    protected void startActivity(Class<?> cls, Bundle bundle) {
        Intent intent = new Intent(this, cls);
        if (bundle != null) {
            intent.putExtras(bundle);
        }
        startActivity(intent);
    }

    protected boolean isLogin() {
        return false;
    }
}
